#ifndef CHILDWND_H
#define CHILDWND_H

#include "Window.h"

class ChildWnd:public Window
{
public:
	ChildWnd(LPCHAR wndName, HWND hParentWnd);
	~ChildWnd(void);

	int width;
	int height;

	virtual void onDeactive();
	virtual void command(HANDLE hControl, WORD id, WORD msg);	
	virtual void onMoveMyTools(int to);
private:
	HWND hParentWnd;

	void onCreate(HWND _hWnd);
	void registerClass();



protected:		
	bool mouseLBD; //Left button down
	bool mouseRBD; //Left button down

	static LPCHAR szClassName;
	static bool registredClass;	
	
	LRESULT CALLBACK objectProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
	static LRESULT CALLBACK classProc( HWND hFrameWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );

	virtual void onLButtonClick(double x, double y);
	virtual void onRButtonClick(double x, double y);
	virtual void onMouseMove(double x, double y);

	virtual void onMouseWeel(double x, double y);	
	virtual void onSize(int nw,int nh);	
	virtual void onKeyDown(DWORD keyCode);

	virtual void onPaint(Graphics* g);
	virtual void onActive();

};

typedef ChildWnd* LPChildWnd;

#endif

